

#include <io.h>

int inb(int port)
{
	int val;
	asm("inb %w1, %b0" : "=r" (val) : "dI" (port));
	
	return val;
}

int inw(int port)
{
	int val;
	asm("inw %w1, %w0" : "=r" (val) : "dI" (port));
	
	return val;
}

int inl(int port)
{
	int val;
	asm("inl %w1, %0" : "=r" (val) : "dI" (port));
	
	return val;
}

void outb(int port, int val)
{
	asm("outb %b0, %w1" : : "ar" (val), "dI" (port));
}

void outw(int port, int val)
{
	asm("outw %w0, %w1" : : "ar" (val), "dI" (port));
}

void outl(int port, int val)
{
	asm("outl %0, %w1" : : "ar" (val), "dI" (port));
}
